﻿namespace Mapper.Core.Config
{
    /// <summary>
    /// etl_lib_sys_property_pattern_config_param Mapper 配置文件
    /// 系统属性模式配置参数
    /// </summary>
    public class PropertyPatternConfigParamMapperProfile : BaseMapperProfile
    {
        /// <summary>
        /// 默认构造
        /// </summary>
        public PropertyPatternConfigParamMapperProfile()
        {
            //映射枚举值
            //CreateMap<Model.Developer.Tool.DbConfig.Database.DatabaseTypeEnum, Dto.Core.Database.DatabaseTypeEnum>()
            //    .ConvertUsingEnumMapping(opt => opt
            //    .MapByValue());

            CreateMap<Entity.Core.Config.PropertyPatternConfigParamEntity, Dto.Core.Config.PropertyPatternConfigParamDto>()
                .ForMember(dest => dest.Error, opt => opt.Ignore())
                .ForMember(dest => dest.ValidationResultInfo, opt => opt.Ignore())
                .ForMember(dest => dest.DtoMode, opt => opt.MapFrom(p => p.EntityMode))
                .ReverseMap();
        }
    }
}
